<html>
<title>web rtc example 1</title>
<body>
<div id="log">


</div>

</body>
<script>
var logElement = document.querySelector('#log');

function logMsg(msg, error) {
    logElement.innerHTML += '<p>' + msg + '</p>';
    if (typeof error !== 'undefined') {
    console.error(error);
    }
}


function getConnectedDevices(type, callback) {
    navigator.mediaDevices.enumerateDevices()
        .then(devices => {
            const filtered = devices.filter(device => device.kind === type);
            callback(filtered);
        });
}

getConnectedDevices('videoinput', cameras => console.log('Cameras found', cameras));

</script>

</html>